package com.bishe.demo.modules.common.entity;

public class SearchBean {
    private int currentPage;//当前页数
    private int pageSize;//页面条数
    private String orderBy;//排序依据的列名
    private String direction;//排序的方向
    private String keyword;//查询的关键字

    public final static int DEFAULT_PAGE_SIZE = 6;//默认每页条数的为10
    public final static int DEFAULT_CURRENT_PAGE = 1;//默认当前页数为1

    public void initSearchBean() {//初始化searchBean
        this.setCurrentPage(this.getCurrentPage() == 0 ? DEFAULT_CURRENT_PAGE : this.getCurrentPage());//判断当前页数是不是为空，是则给它赋初始值
        this.setPageSize(this.getPageSize() == 0 ? DEFAULT_PAGE_SIZE : this.getPageSize());//判断页面条数是不是为空，是则给它赋初始值
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

}
